import React, { useEffect } from 'react'
import { Form, Input, Button, message } from 'antd';
import request from '../../../../libs/request';
const ServerParameters = () => {
    const [form] = Form.useForm();

    useEffect(() => {
        request("/api/gslock/readip").then(res => {
            if (res.code != 0) return message.error(res.msg)
          
            form.setFieldsValue({
                ip: res.ip,
                mask: res.mask,
                gateway: res.gateway,
                dns: res.dns
            })
        })
    }, [])
    const GetMsg = () => {

    }
    GetMsg()
    return (
        <div style={{ marginTop: '3vh' }}>
            <div
                style={{ fontSize: '20px', fontWeight: '550', margin: "30px" }}
            >服务器参数配置</div>
            <Form
                name="basic"
                labelCol={{ span: 4 }}
                wrapperCol={{ span: 16 }}
                style={{ maxWidth: 650 }}
                autoComplete="off"
                form={form}
            >
                <Form.Item
                    label="IP地址"
                    name="ip"

                >
                    <Input />
                </Form.Item>

                <Form.Item
                    label="子网掩码"
                    name="mask"

                >
                    <Input />
                </Form.Item>

                <Form.Item
                    label="网关ip"
                    name="gateway"

                >
                    <Input />
                </Form.Item>
                <Form.Item
                    label="DNS地址"
                    name="dns"

                >
                    <Input />
                </Form.Item>

                <Form.Item wrapperCol={{ offset: 4, span: 16 }}>
                    <Button type="primary" htmlType="submit">
                        保存IP并设置
                    </Button>

                </Form.Item>
            </Form>
        </div>
    )
}

export default ServerParameters